#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import gtk
from gtk import glade
import flash


class AboutDialog:
    def url(self, dialog, link, user_data):
        import webbrowser
        webbrowser.open(link, 0, 1)
		
    def __init__(self):
        gtk.about_dialog_set_url_hook(self.url, None)
        self.wTree = gtk.glade.XML(flash.app.glade_file, "flash_about")
        
        self.window = self.wTree.get_widget("flash_about")
        self.window.set_icon_from_file(os.path.join(
            flash.app.data_dir, "flash-64.png"))
        self.window.set_name(flash.__name__)
        self.window.set_version(flash.__version__)
        self.window.set_logo(gtk.gdk.pixbuf_new_from_file(
            os.path.join(flash.app.data_dir, "flash-b.png")))
        self.window.show_all()
        
    def run(self):
        self.window.run()
        self.window.destroy()
